<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2017/7/10
 * Time: 15:22
 */
namespace Admin\Model;
use Base\Model\BaseModel;

class InspectioniteminfoModel extends BaseModel
{
    protected $_validate = array(
     array('name', 'require', '名称必须填写'),
//array('name', '', '名称不能重复', 0, 'unique', 3),
        //array('name','/^[a-zA-Z_\x{4e00}-\x{9fa5}]+$/u', '名称不符合规则！',3),
       // array('name_en','/^[a-zA-Z]+$/','英文名称必须为英文！',2),
       // array('short_name_en','/^[a-zA-Z]+$/', '缩略英文名称必须为英文！',2),
    );
    protected $_auto = array(
//        array('createtime','mydate','1','callback'),
//        array('lastedittime','mydate','3','callback'),
        array('status','1')
    );
//    protected function mydate(){
//        return date("Y-m-d H:i:s");
//    }
    protected $_link = array(
        'iteminfo'=>array(
            'mapping_type'=>self::BELONGS_TO,
            'class_name'=>'dimdailyiteminfo',
            'foreign_key' => 'dimensionid',
            'parent_key' => 'id',
        )
    );

}